package com.teach.servlet.admin;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.teach.entity.Lj;
import com.teach.service.LjService;
import com.teach.service.impl.LjServiceImpl;

//@WebServlet("/admin/lj-look.let")
public class LjLookServlet extends HttpServlet{

	private LjService ljService = new LjServiceImpl();
	@Override
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		Long ljId = null;
		Lj lj = null;
		try {
			ljId = Long.valueOf(request.getParameter("ljId"));
			lj = ljService.get(ljId);
		}catch(Exception e) {
			e.printStackTrace();
			throw new ServletException("参数错误",e);
		}
		request.setAttribute("lj",lj);
		request.getRequestDispatcher("/admin/lj-look.jsp").forward(request, response);
	}
}
